package com.example.eeuse.model;

import lombok.Data;
import org.dromara.easyes.annotation.*;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.DefaultSettingsProvider;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

/**
 * ES数据模型
 *
 * Copyright © 2021 xpc1024 All Rights Reserved
 **/
@Data
@IndexName(value = "document_2014")
public class Document {
    /**
     * es中的唯一id
     */
    @IndexId(type = IdType.CUSTOMIZE)
    private String id;

    /**
     * 文档标题
     */
    private String title;

    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_MAX_WORD)
    private String name;

    @IndexField(fieldType = FieldType.KEYWORD)
    private String type;

    /**
     * 文档内容
     */
    @HighLight(mappingField = "highlightContent")
    @IndexField(value = "attachment.content", fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String content;

    private String highlightContent;

    @IndexField(exist = false)
    private String attachment;

}
